package com.service.manage.imp;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.mapper.manage.UserRoleDao;
import com.po.Role;
import com.po.User;
import com.po.UserRole;
import com.service.manage.UserRoleService;

@Service
public class UserRoleServiceImp implements UserRoleService {
	@Resource(name = "userRoleDao")
	private UserRoleDao userRoleDao;

	@Override
	public int addUserRole(UserRole userRole) {
		int i = userRoleDao.addUserRole(userRole);
		return i;
	}



	@Override
	public List<User> getUserole(User user) {
		// TODO Auto-generated method stub
		List<User> list =userRoleDao.getUserRoleList(user);
		return list;
	}



	@Override
	public int updateUserRole(UserRole userRole) {
		// TODO Auto-generated method stub
		int i = userRoleDao.updateUserRole(userRole);
		return i;
	}



	@Override
	public int updateUsersReg(User user, UserRole userRole) {
		// TODO Auto-generated method stub
		int i = userRoleDao.updateUserRole(userRole);
		i = userRoleDao.updateUsersReg(user);
		return i;
	}



	@Override
	public List<Role> getRolesList() {
		// TODO Auto-generated method stub
		List<Role> list = userRoleDao.getUserRolesList();
		return list;
	}



	@Override
	public List<UserRole> getRolesListArray(User user) {
		// TODO Auto-generated method stub
		List<UserRole> list = userRoleDao.getRolesListArray(user);
		return list;
	}


}
